﻿using System;
using nRoute.Components.Composition;
using nRoute.Utilities;

namespace nRoute.Mapping
{
    [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, AllowMultiple = true, Inherited = false)]
    public class MapViewAttribute
		 : MapViewViewModelBaseAttribute
    {
        public MapViewAttribute(Type viewModelType) 
            : base()
        {
            Guard.ArgumentNotNull(viewModelType, "viewModelType");
            base.ViewModelType = viewModelType;
        }

#region Overrides

        protected internal override IResourceLocator GetResourceLocator(Type targetType, ITypeBuilder typeBuilder)
        {
            base.ViewType = targetType;
            return base.GetResourceLocator(targetType, typeBuilder);
        }

#endregion

    }
}